// onstSpringFunction.h: interface for the ConstSpringFunction class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ONSTSPRINGFUNCTION_H__19BC8D00_3ADD_47FF_BBAD_CCB76E0626DF__INCLUDED_)
#define AFX_ONSTSPRINGFUNCTION_H__19BC8D00_3ADD_47FF_BBAD_CCB76E0626DF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ConstSpring.h"
#include "Variable.h"
#include "FunctionObject.h"

class AFX_EXT_CLASS ConstSpringFunction : public FunctionObject  
{
	DECLARE_DYNAMIC_CREATE(ConstSpringFunction)
public:
	ConstSpringFunction();
	virtual ~ConstSpringFunction();

public:
	virtual BOOL Execute();

public:
	void ConstSpringDH(Variable* pVariable){
		ASSERT(pVariable);
		m_pDH = pVariable;
	}

	Variable* ConstSpringDH(){
		return m_pDH;
	}

	void MinDis(Variable* pVariable){
		ASSERT(pVariable);
		m_pMinDis = pVariable;
	}

	Variable* MinDis(){
		return m_pMinDis;
	}

	void MaxDis(Variable* pVariable){
		ASSERT(pVariable);
		m_pMaxDis = pVariable;
	}

	Variable* MaxDis(){
		return m_pMaxDis;
	}

private:
	DOUBLE GetDisplacement();
	ConstSpring* GetConstSpring();
	BOOL GetConstSpringPart(ConstSpring* pSpring);
	BOOL InstanceConstSpringPort();

private:
	Variable* m_pMinDis;
	Variable* m_pMaxDis;
	Variable* m_pDH;
};

#endif // !defined(AFX_ONSTSPRINGFUNCTION_H__19BC8D00_3ADD_47FF_BBAD_CCB76E0626DF__INCLUDED_)
